﻿using ClassLibrary1;
using DependencyAnalysis.DataModel;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace UnitTests
{
    [TestClass]
    public class AnalyzedMetricsTest : AnalyzerTestBase
    {
        [TestMethod]
        public void NumberOfFieldsForType()
        {
            var typeDescriptor = DescriptorBuilder.BuildTypeDescriptor(typeof(PureDataObject));
            var numberOfFields = Metrics.NumberOfFields(typeDescriptor);
            Assert.AreEqual(7, numberOfFields);
        }

        [TestMethod]
        public void NumberOfMethodsIgnoresGetterAndSetter()
        {
            var typeDescriptor = DescriptorBuilder.BuildTypeDescriptor(typeof(DataObjectWithFewMethods));
            var numberOfMethods = Metrics.NumberOfMethods(typeDescriptor);
            Assert.AreEqual(3, numberOfMethods);
        }

    }
}
